<?php
session_start();
$username = $_REQUEST['username'];

include("sqlconnection.php");

$db = new Database();
$db->connect();

$query = "select * from usertable where username = '$username'";

$result = mysql_query($query);
print mysql_num_rows($result);
while($row = mysql_fetch_array($result)){
	$gender = $row ['gender'];
	$dob = $row['dob'];
	$firstname = $row['firstname'];
	$occupation = $row['occupation'];
	$email = $row['email'];
	$aboutme = $row['about_me'];
	$pro_pic = $row['profile_pic'];
	$nationality = $row['nationality'];
}
$db->disconnect();

?>
<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<title>jQuery Mobile Web App</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-green-button-theme.css" rel="stylesheet" type="text/css"/>
<link href="css/jq-mobile-red-button-theme.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
<!-- This reference to phonegap.js will allow for code hints as long as the current site has been configured as a mobile application. 
	 To configure the site as a mobile application, go to Site -> Mobile Applications -> Configure Application Framework... -->
<script src="js/phonegap.js" type="text/javascript"></script>
</head> 
<body> 

<div data-role="page" id="page2" data-theme="c">
	<div data-role="header" data-theme='a'>
		<a href="property.html"  data-rel="back" data-icon="back" data-icon="back">Back</a>
         <a href="logout.php" data-role="button" data-icon="delete" rel="external">Logout</a>
        <h1>User Profile</h1>
	</div>
	<div data-role="content">
    	<table>
        <tr>
        
    		<td><img src='<?php print $pro_pic; ?>' width="100" height="140"/></td>
            <td style="padding-left:10px;">
        	<strong>Name :  <?php print $firstname; ?></strong>
            <p><?php  print $gender; ?></p>
            <p>DOB: <?php print $dob; ?></p>
           <?php print "<img src='./images/$nationality.png' width='30' height='30'/>"; ?></td>
       		</tr>
        </table><br>
        <ul data-role="listview" data-theme='c'>
         <li data-role="header" role="heading" data-theme='a'>Occupation</li>
         <li><?php print $occupation;?></li>
         <li data-role="header" role="heading" data-theme='a'>Email</li>
       	<li><?php print $email; ?> </li>
       <li data-role="header" role="heading" data-theme='a'>About Me</li>
       <li><?php print $aboutme; ?></li>
         <li><a href="match.php?rusername=<?php print $username?>" rel="external" >Behavioural traits
         </a>
         </li>
         </ul>
    </div>
</div>

</body>
</html>